<include file="./Application/Admin/View/Public/htmlheader.html"/>
<include file="./Application/Admin/View/Public/header.html"/>
<include file="./Application/Admin/View/Public/left.html"/>

<ol class="breadcrumb">
    <li><a href="/Admin">首页</a></li>
    <li class="active">教师列表</li>
</ol>

<div class="row">
    <div class="col-lg-12">
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <tr class="success">
                    <th>教师名</th>
                    <th>教师等级</th>
                    <th>毕业院校</th>
                    <th>简介</th>
                    <th>操作</th>
                </tr>
                <volist name="list" id="vo">
                    <tr>
                        <td>{$vo.name}</td>
                        <td>{$vo.level}</td>
                        <td>{$vo.school}</td>
                        <td>{$vo.content}</td>
                        <td>
                            <if condition="$permission['editTeacher'] eq TRUE">
                                <a href="__ROOT__/Admin/Teacher/editTeacher?id={$vo['id']}"
                                   class="btn btn-info btn-xs">编辑</a>
                            </if>
                            <if condition="$permission['delTeacher'] eq TRUE">
                                <a href="__ROOT__/Admin/Teacher/delTeacher?id={$vo['id']}"
                                   onclick="return confirm('确定删除?');" class="btn btn-danger btn-xs">删除</a>
                            </if>
                        </td>
                    </tr>
                </volist>
            </table>
            <if condition="$permission['addTeacher'] eq TRUE">
                <div class="row">
                    <div class="col-lg-3">
                        <button class="btn btn-primary" data-toggle="modal" data-target="#addCategory">添加教师</button>
                    </div>
                </div>
            </if>
        </div>
    </div>
</div>

<!--   添加用户 弹出层   -->
<div class="modal fade" id="addCategory" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">添加教师</h4>
            </div>
            <form action="__ROOT__/Admin/Teacher/addTeacher" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>教师名：</p></div>
                        <div class="col-lg-6"><input type="text" name="name" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>教师等级：</p></div>
                        <div class="col-lg-6">
                            <select class="form-control" name="level" id="level">
                                <option value="1">特级教师</option>
                                <option value="2">普通教师</option>
                            </select>
                        </div>

                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>毕业院校：</p></div>
                        <div class="col-lg-6"><input type="text" name="school" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>学科：</p></div>
                        <div class="col-lg-6">
                            <select class="form-control" name="subjectsId" id="subjectsId">
                                <foreach name="subjectsList" item="vo">
                                    <option value="{$vo.id}">{$vo.name}</option>
                                </foreach>
                            </select>
                        </div>

                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>领域：</p></div>
                        <div class="col-lg-6">
                            <select class="form-control" name="teachingId" id="teachingId">
                                <foreach name="teachingList" item="vo">
                                    <option value="{$vo.id}">{$vo.name}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>简介：</p></div>
                        <div class="col-lg-6"><textarea name="content" class="form-control"></textarea></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>图片：</p></div>
                        <div class="col-lg-6"><input type="file" name="pic" class="form-control"/></div>
                    </div>
                    <br/>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>

<include file="./Application/Admin/View/Public/footer.html"/>